package com.example.testoink;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.RelativeLayout;

public class IntroActivity extends Activity {

	ImageView storyImg;
	int storyNum = 1;
	RelativeLayout myLayout;
	
	
	
	public void nextStory(View v){
		
		storyNum++;
		
		if(storyNum<4){
		
		storyImg.setImageResource(getResources().getIdentifier((String)"story"+storyNum, "drawable",getPackageName()));
		}else{
			
			Intent intent = new Intent(IntroActivity.this,StartActivity.class);
			
			startActivity(intent);
			
		}
	}
	
	public void createStory(){
		
		RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1480,1000);
		storyImg = new ImageView(this);
		storyImg.setImageResource( R.drawable.story1);
		storyImg.setX(100);
		storyImg.setY(0);
		//storyImg.setId(id);
		//enemyId = id-21;
		myLayout.addView(storyImg, params);
		
		
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_intro);
		myLayout = (RelativeLayout)findViewById(R.id.rela2);
		createStory();
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.intro, menu);
		return true;
	}

}
